<div class="searchCondition">
  <div class="searchConditionHeader">
    <img src="/assets/main/prescriptions/searchConditionLogo.jpg">
    <button class="batchRepulse" (click)="batchOperate('repulse')">批量打回</button>
    <button class="batchAccept" (click)="batchOperate('pass')">批量通过</button>
    <button class="batchAccept" (click)="refesh()">刷新</button>
    <app-auto-audit-button></app-auto-audit-button>
    <table class="timePicker" *ngIf= 'prescriptionType === 2'>
      <tbody>
        <tr>
          <td class="link_black time-wrap"><strong>开始日期：</strong></td>
          <td class="right_distance">
              <nv-date-picker class="patient_date time-val" [(ngModel)]="searchParams['start_date']" [nvAllowClear]=false 
              nvPlaceHolder="" nvShowTime></nv-date-picker>
          <td class="link_black time-wrap"><strong>结束日期：</strong></td>
          <td class="right_distance">
            <nv-date-picker class="patient_date time-val" [nvDisabledDate]="disabledDate" [(ngModel)]="searchParams['end_date']" [nvAllowClear]=false 
              nvPlaceHolder="" nvShowTime></nv-date-picker>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <div class="searchConditionContent">
    <form #prescriptionsForm="ngForm" (ngSubmit)="obtainPatientList()">
      <table>
        <tbody>
          <tr>
            <td><b>处方单号:</b><input type="text" [(ngModel)]="prescriptions" name="prescriptions"></td>
            <td><b>病人姓名:</b><input type="text" [(ngModel)]="patientName" name="patientName"></td>
            <td><b class="verticalMiddle">科室:</b><input type="text" [(ngModel)]="administrativeOffice" name="administrativeOffice"></td>
            <td>
              <b>开方医生:</b>
              <input type="text" [(ngModel)]="doctor" name="doctor">
            </td>
            <td>
              <b>处方状态:</b>
              <select [(ngModel)]="status" name="status">
                <!-- <option value="请选择" disabled>请选择</option> -->
                <option value="">全部</option>
                <option value="2">未通过</option>
                <option value="1">已通过</option>
              </select>
            </td>
            <td>
              <b>违规原因:</b>
              <select [(ngModel)]="illegalReason" name="illegalReason">
                <!-- <option value="请选择" disabled>请选择</option> -->
                <option value="">全部</option>
                <option value="2">配伍禁忌</option>
                <option value="1">药量超标</option>
                <option value="3">其他</option>
              </select>
            </td>
            <td>
              <button type="submit" class="searchButton"></button>
              <!-- <input type="image" src="images/bg34.jpg" name="button3" id="button3" value="提交"> -->
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </div>
</div>
<div class="patientList">
  <table>
    <tr>
      <th>序号</th>
      <th>处方号</th>
      <th>病人姓名</th>
      <th>开方医生</th>
      <th>诊断</th>
      <th>贴数</th>
      <th>备注</th>
      <th>系统审核</th>
      <th>人工审核</th>
      <th *ngIf= 'prescriptionType === 2'>开方日期</th>
      <th>操作</th>
    </tr>
    <tr *ngFor="let item of patientList; let i = index" [ngClass]="{'backgroundGrey': i%2===0,'backgroundWhite': i%2!==0}">
      <td valign="middle" width="35"><input type="checkbox" [(ngModel)]="item.checked">{{i+1}}</td>
      <td width="120">{{item['处方id'] }}</td>
      <td width="100">{{item['病人姓名']}}</td>
      <td width="100">{{item['开方医生']}}</td>
      <td width="100">{{item['诊断']}}</td>
      <td width="100">{{item['贴数']}}</td>
      <td [title]="item['备注']" width="100" (click)="openRemarks(i)"><div class="overflow messageRemark">{{item['备注']}}</div></td>
      <td width="70">{{item['系统审核'] | systemAudit}}</td>
      <td width="70" class="colorRed">{{item['人工审核'] | manuallyReview}}</td>
      <td width="120" *ngIf= 'prescriptionType === 2'>{{item['开方日期']}}</td>
      <td width="150" (click)="itemOperation(i,$event)">
        <span>查看</span>
        <span class="divideLine"></span>
        <span>通过</span>
        <span class="divideLine"></span>
        <span class="colorRed">打回</span>
      </td>
    </tr>
  </table>
  <div *ngIf="patientList.length !== 0" class="pagination" (click)="goToPage($event)">
    <button class="recordBtn" (click)="operatingRecord()">
          操作记录
    </button>
    <span class="cursor">首页</span>
    <span class="cursor">上一页</span>
    <span class="cursor">下一页</span>
    <span class="cursor">尾页</span>
    <span>页次:</span>
    <span>{{currentPage}}/{{pages}}</span>
    <span>共{{total}}条记录</span>
    <span>20条记录/页</span>
    <span>转到:</span>
    <span><input type="text" [(ngModel)]="targetPage"></span>
    <span> <button type="button">Goto</button></span>
  </div>
</div>
<div class="footer">
    上海市中医文献馆版权所有
</div>  
<div class="remarkModel" *ngIf="showModels" (click)="closeModel()">
  <div class="modelInput" (click)="stopPropagation($event)" >
    <div class="modelTitle">确认提示</div>
    <div class="modelContent">
      <textarea placeholder='请输入原因' [(ngModel)]="modelTextarea"></textarea>
    </div>
    <div class="modelButton">
      <button (click)="confirmModel()">确认</button>
      <button (click)="closeModel()">取消</button>
    </div>
  </div>
</div>
<!-- <div class="footer">
  <div class="footContent">上海市中医文献馆版权所有</div>
</div>   -->
